Skip to content

chore(fast-inbox): emit inbox lag and checkpoint cap from the constants generator (A-1434) - #24794

Closed
spalladino wants to merge 2 commits into
spl/a-1388-node-cleanupfrom
spl/a-1434-inbox-constants-gen
Closed

chore(fast-inbox): emit inbox lag and checkpoint cap from the constants generator (A-1434)#24794
spalladino wants to merge 2 commits into
spl/a-1388-node-cleanupfrom
spl/a-1434-inbox-constants-gen

Conversation

@spalladino

Copy link
Copy Markdown
Contributor

Moves INBOX_LAG_SECONDS (12) and MAX_L1_TO_L2_MSGS_PER_CHECKPOINT (1024) out of the hand-declared file-scope constants in ProposeLib.sol and into the generated Constants library, giving L1 Solidity and the TS node a single source of truth (A-1434, Fast Inbox cleanup).

Both values already lived in constants.nr (the Noir source of truth) and were already emitted to constants.gen.ts; the only gap was the Solidity side, which gates emission behind an allowlist.

  • Add both names to the SOLIDITY_CONSTANTS allowlist in constants/src/scripts/constants.in.ts, so yarn remake-constants emits them into ConstantsGen.sol. constants.gen.ts is unchanged (already present).
  • Regenerate ConstantsGen.sol (generator output; not hand-edited).
  • ProposeLib.sol imports Constants and references the generated values; the hand-declared file-scope copies are deleted.
  • Update ProposeInboxConsumption.t.sol to import the constants from ConstantsGen.sol instead of ProposeLib.sol.

TS node code that validates inbox consumption (stdlib cutoff predicate, validator-client streaming checks, sequencer-client bucket selector) already reads these from @aztec/constants, so no TS source change is needed.

Testing:

  • forge build and forge test test/rollup/ProposeInboxConsumption.t.sol (15 tests) pass.
  • The three TS regression suites pass: stdlib inbox_consumption (10), validator-client streaming_inbox_checks (14), sequencer-client inbox_bucket_selector (9).
  • @aztec/constants, @aztec/l1-artifacts, and @aztec/ethereum build.

Part of the Fast Inbox stack, on top of #24784..#24793.

@spalladino
spalladino requested a review from just-mitch as a code owner July 18, 2026 23:23
@spalladino
spalladino force-pushed the spl/a-1388-node-cleanup branch from 92cecbd to 83a74e1 Compare July 19, 2026 01:25
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch from 57e98bd to beda331 Compare July 19, 2026 01:25
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch from beda331 to c49ff84 Compare July 19, 2026 14:05
@spalladino
spalladino force-pushed the spl/a-1388-node-cleanup branch from 115b351 to 5817030 Compare July 19, 2026 15:10
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch 2 times, most recently from eaae5fb to 2d2d3cf Compare July 19, 2026 15:36
@spalladino
spalladino force-pushed the spl/a-1388-node-cleanup branch from 5817030 to 01b921a Compare July 19, 2026 15:36
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch from 2d2d3cf to a63553a Compare July 19, 2026 17:57
@spalladino
spalladino force-pushed the spl/a-1388-node-cleanup branch from 01b921a to 6269f44 Compare July 19, 2026 17:57
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch from a63553a to 17bdffa Compare July 19, 2026 18:02
@spalladino
spalladino force-pushed the spl/a-1388-node-cleanup branch from 6269f44 to 3111d18 Compare July 19, 2026 18:02
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch 2 times, most recently from 9d89bdc to b6660d3 Compare July 19, 2026 20:30
@spalladino
spalladino force-pushed the spl/a-1388-node-cleanup branch 2 times, most recently from 5660774 to 7fa4b0a Compare July 19, 2026 20:48
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch 3 times, most recently from ab7ddb2 to 43c8567 Compare July 20, 2026 13:32
@spalladino
spalladino force-pushed the spl/a-1388-node-cleanup branch from 0224d57 to 02cd879 Compare July 20, 2026 13:32
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch from 43c8567 to 6da2093 Compare July 20, 2026 14:07
@spalladino
spalladino force-pushed the spl/a-1388-node-cleanup branch from 02cd879 to 05a1f0c Compare July 20, 2026 14:07
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch from 6da2093 to a84640b Compare July 20, 2026 15:30
@spalladino
spalladino force-pushed the spl/a-1388-node-cleanup branch from 05a1f0c to 93b18af Compare July 20, 2026 15:30
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch from a84640b to dd49e4e Compare July 20, 2026 17:28
@spalladino
spalladino force-pushed the spl/a-1388-node-cleanup branch 2 times, most recently from 5cc8950 to 94dec7d Compare July 20, 2026 21:21
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch from dd49e4e to 99a9a56 Compare July 20, 2026 21:21
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch from 99a9a56 to c2772d6 Compare July 21, 2026 02:58
@spalladino
spalladino force-pushed the spl/a-1388-node-cleanup branch 2 times, most recently from 855ee1c to 8c420b7 Compare July 21, 2026 03:39
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch from c2772d6 to 7090792 Compare July 21, 2026 03:39
@spalladino
spalladino force-pushed the spl/a-1388-node-cleanup branch from 8c420b7 to d691947 Compare July 21, 2026 04:43
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch 2 times, most recently from c97f0d5 to a359b58 Compare July 21, 2026 12:06
@spalladino
spalladino force-pushed the spl/a-1388-node-cleanup branch 2 times, most recently from b32e629 to 834ca00 Compare July 21, 2026 15:02
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch 2 times, most recently from 8067503 to 16e6223 Compare July 21, 2026 22:32
@spalladino
spalladino force-pushed the spl/a-1388-node-cleanup branch from 834ca00 to 5883528 Compare July 21, 2026 22:32
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch from 16e6223 to c4637fd Compare July 21, 2026 22:39
@spalladino
spalladino force-pushed the spl/a-1388-node-cleanup branch from 398aa38 to f0fb1e1 Compare July 27, 2026 20:53
@spalladino
spalladino force-pushed the spl/a-1434-inbox-constants-gen branch from c4637fd to 30d8f66 Compare July 27, 2026 20:53
…ts generator (A-1434)

Add INBOX_LAG_SECONDS and MAX_L1_TO_L2_MSGS_PER_CHECKPOINT to the Solidity
constants allowlist so the generator emits them into ConstantsGen.sol, matching
the values already present in constants.gen.ts. ProposeLib and its consumption
test now read the generated Constants library instead of the hand-declared
file-scope copies, giving L1 and TS a single source of truth.
@spalladino

Copy link
Copy Markdown
Contributor Author

Superseded by #25038.

The Fast Inbox stack has been regrouped from 20 per-issue PRs (plus 2 umbrellas) down to 3 area PRs plus an umbrella, and rebased onto merge-train/spartan including #25007 (the noir-projects fnd//labs/ split). This PR's diff is preserved verbatim as a single squashed commit in #25038, and this description is preserved in that commit's message.

New structure: #25036 (circuits + L1) → #25037 (node + flip) → #25038 (cleanup), with #25039 as the full-stack umbrella. The original branch for this PR is left on the remote as a recovery point.

Closing here to cut the rebase and review overhead of maintaining 22 PRs; the work is not abandoned.

@spalladino spalladino closed this Jul 28, 2026
spalladino added a commit that referenced this pull request Jul 28, 2026
…ts generator (A-1434)

Moves `INBOX_LAG_SECONDS` (12) and `MAX_L1_TO_L2_MSGS_PER_CHECKPOINT` (1024) out of the hand-declared file-scope constants in `ProposeLib.sol` and into the generated `Constants` library, giving L1 Solidity and the TS node a single source of truth (A-1434, Fast Inbox cleanup).

Both values already lived in `constants.nr` (the Noir source of truth) and were already emitted to `constants.gen.ts`; the only gap was the Solidity side, which gates emission behind an allowlist.

- Add both names to the `SOLIDITY_CONSTANTS` allowlist in `constants/src/scripts/constants.in.ts`, so `yarn remake-constants` emits them into `ConstantsGen.sol`. `constants.gen.ts` is unchanged (already present).
- Regenerate `ConstantsGen.sol` (generator output; not hand-edited).
- `ProposeLib.sol` imports `Constants` and references the generated values; the hand-declared file-scope copies are deleted.
- Update `ProposeInboxConsumption.t.sol` to import the constants from `ConstantsGen.sol` instead of `ProposeLib.sol`.

TS node code that validates inbox consumption (`stdlib` cutoff predicate, `validator-client` streaming checks, `sequencer-client` bucket selector) already reads these from `@aztec/constants`, so no TS source change is needed.

Testing:
- `forge build` and `forge test test/rollup/ProposeInboxConsumption.t.sol` (15 tests) pass.
- The three TS regression suites pass: `stdlib` inbox_consumption (10), `validator-client` streaming_inbox_checks (14), `sequencer-client` inbox_bucket_selector (9).
- `@aztec/constants`, `@aztec/l1-artifacts`, and `@aztec/ethereum` build.

Part of the Fast Inbox stack, on top of #24784..#24793.


Replaces #24794.
spalladino added a commit that referenced this pull request Jul 28, 2026
…neration (A-1435)

Deduplicates how the committed rollup protocol-circuit sample inputs (`noir-projects/noir-protocol-circuits/crates/rollup-*/Prover.toml`) get regenerated. Two paths previously both wrote `rollup-block-root-first`, `rollup-block-root-first-single-tx`, `rollup-checkpoint-root-single-block`, `rollup-checkpoint-merge`, and `rollup-root`, so the committed fixtures drifted depending on which ran last.

- Makes the prover-client `regenerate_rollup_sample_inputs.test.ts` suite the sole owner of every rollup circuit at or above the transaction merge: the block-root variants, block-merge, both checkpoint roots, checkpoint-merge, tx-merge, and root.
- Stops the e2e `full.test.ts` dump from writing the block-root and checkpoint samples it overlapped on. The e2e dump now regenerates only what needs real client-proved transactions the simulated orchestrator cannot produce: the private-kernel circuits and the transaction-base rollups (`rollup-tx-base-private`, `rollup-tx-base-public`).
- Adds a dedicated three-tx scenario to the suite to restore `rollup-tx-merge` coverage, which was dropped when `orchestrator_single_checkpoint.test.ts` was deleted and replaced by this suite. A block with three txs forces one tx-merge before the two-input block root, whereas one- or two-tx blocks feed the block root directly.
- Updates the regen docs (`barretenberg/cpp/CLAUDE.md`, the `update-prover-toml` and `gate-counts` skills, and the `updateProtocolCircuitSampleInputs` JSDoc) to the two-command split and removes the dead `orchestrator_single_checkpoint.test.ts` references.

Ownership after this change (each committed rollup `Prover.toml` has exactly one writer, no overlap):

- prover-client suite (`AZTEC_GENERATE_TEST_DATA=1 yarn workspace @aztec/prover-client test regenerate_rollup_sample_inputs`): the 11 block-root / block-merge / checkpoint / tx-merge / root tomls.
- e2e (`AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1` full.test): private-kernel circuits plus `rollup-tx-base-private` / `rollup-tx-base-public`.

Part of the Fast Inbox (AZIP-22) cleanup stack, on top of #24784..#24794.

Validation: neither regeneration path runs in this environment (the prover-client build here has stale artifacts and e2e needs a full L1/anvil stack), so the actual fixture regeneration and the downstream `nargo execute` checks are validated on CI. Locally verified statically that the suite's scenario `dump` arrays plus the e2e list exactly cover all 13 committed rollup tomls with no overlap, and that a three-tx block routes through `getTxMergeRollupProof` and captures `rollup-tx-merge` test data.

Post-flip a zero-tx non-first block carrying a bundle is a live shape routed through the msgs-only block root (wired in #24789), so the regen suite gains a per-block-distribution scenario dumping `rollup-block-root-msgs-only`, and the circuit joins the CI `nargo execute` list — the first regen run must create and commit its `Prover.toml`. The documented e2e regen command also moves to the file's real location (`single-node/prover/server/full.test`; the old `e2e_prover/full.test` jest pattern matches nothing).

Replaces #24795.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant